/**
 * Created by Administrator on 2019/6/11.
 */
var swiper = new Swiper('.swiper-container', {
    spaceBetween: 30,
    centeredSlides: true,
    autoplay: {
        delay: 2500,
        disableOnInteraction: false,
    },
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
    },
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
    loop:1,
})
// var m = document.querySelector("#shuru");
// console.log(m);
// var qe = function () {
//     xiala.style.display = "block";
// }

// body.addEventListener('click',function(){
//     xiala.style.display = "none";
// })

var vm = new Vue({
    el:"#app",
    data:{
        message:'正在调取数据'
    },
    mounted(){
        axios
            .get('json/news.json')
            .then(response => (this.message = response.data.asd))
    .catch(function (error) {
            console.log(error);
        });
    }

})

var vm = new Vue({
    el:"#app_2",
    data:{
        message:'正在调取数据'
    },
    mounted(){
        axios
            .get('json/news.json')
            .then(response => (this.message = response.data.qwe))
            .catch(function (error) {
                console.log(error);
            });
    }

})
var vm = new Vue({
    el:"#app_3",
    data:{
        message:'正在调取数据'
    },
    mounted(){
        axios
            .get('json/news.json')
            .then(response => (this.message = response.data.zxc))
            .catch(function (error) {
                console.log(error);
            });
    }

})
var vm = new Vue({
    el:"#app_4",
    data:{
        message:'正在调取数据'
    },
    mounted(){
        axios
            .get('json/news.json')
            .then(response => (this.message = response.data.tyu))
            .catch(function (error) {
                console.log(error);
            });
    }

})
var vm = new Vue({
    el:"#app_5",
    data:{
        message:'正在调取数据'
    },
    mounted(){
        axios
            .get('json/news.json')
            .then(response => (this.message = response.data.jkl))
            .catch(function (error) {
                console.log(error);
            });
    }

})

var t = document.querySelector("#left_fix");
window.onscroll = function () {
    if ( document.body.scrollTop >= 500 || document.documentElement.scrollTop >= 500){
        t.style.display = 'block';
        list1.style.background = 'red';
        list1_txt.style.color = '#fff';
        list2.style.background = '#eee';
        list2_txt.style.color = '#666';
        list3.style.background = '#eee';
        list3_txt.style.color = '#666';
        list4.style.background = '#eee';
        list4_txt.style.color = '#666';
        list5.style.background = '#eee';
        list5_txt.style.color = '#666';
        list6.style.background = '#eee';
        list6_txt.style.color = '#666';

    }else {
        t.style.display = 'none';

    }
    list1.addEventListener('click',function(){
        window.scrollTo({
            top:600,
            behavior:'smooth'
        })
    })
    if ( document.body.scrollTop >= 700 || document.documentElement.scrollTop >= 700){
        list2.style.background = 'red';
        list2_txt.style.color = '#fff';
        list1.style.background = '#eee';
        list1_txt.style.color = '#666';
        list3.style.background = '#eee';
        list3_txt.style.color = '#666';
        list4.style.background = '#eee';
        list4_txt.style.color = '#666';
        list5.style.background = '#eee';
        list5_txt.style.color = '#666';
        list6.style.background = '#eee';
        list6_txt.style.color = '#666';


    }else {


    }
    list2.addEventListener('click',function(){
        window.scrollTo({
            top:700,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 1400 || document.documentElement.scrollTop >= 1400){
        list3.style.background = 'red';
        list3_txt.style.color = '#fff';
        list4.style.background = '#eee';
        list4_txt.style.color = '#666';
        list5.style.background = '#eee';
        list5_txt.style.color = '#666';
        list6.style.background = '#eee';
        list6_txt.style.color = '#666';
        list2.style.background = '#eee';
        list2_txt.style.color = '#666';
        list1.style.background = '#eee';
        list1_txt.style.color = '#666';

    }else {

    }
    list3.addEventListener('click',function(){
        window.scrollTo({
            top:1400,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 2100 || document.documentElement.scrollTop >= 2100){
        list3.style.background = '#eee';
        list3_txt.style.color = '#666';
        list4.style.background = 'red';
        list4_txt.style.color = '#fff';
        list5.style.background = '#eee';
        list5_txt.style.color = '#666';
        list6.style.background = '#eee';
        list6_txt.style.color = '#666';
        list2.style.background = '#eee';
        list2_txt.style.color = '#666';
        list1.style.background = '#eee';
        list1_txt.style.color = '#666';

    }else {

    }
    list4.addEventListener('click',function(){
        window.scrollTo({
            top:2100,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 2800 || document.documentElement.scrollTop >= 2800){
        list3.style.background = '#eee';
        list3_txt.style.color = '#666';
        list4.style.background = '#eee';
        list4_txt.style.color = '#666';
        list5.style.background = 'red';
        list5_txt.style.color = '#fff';
        list6.style.background = '#eee';
        list6_txt.style.color = '#666';
        list2.style.background = '#eee';
        list2_txt.style.color = '#666';
        list1.style.background = '#eee';
        list1_txt.style.color = '#666';

    }else {

    }
    list5.addEventListener('click',function(){
        window.scrollTo({
            top:2800,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 3416 || document.documentElement.scrollTop >= 3416){
        list3.style.background = '#eee';
        list3_txt.style.color = '#666';
        list4.style.background = '#eee';
        list4_txt.style.color = '#666';
        list5.style.background = '#eee';
        list5_txt.style.color = '#666';
        list6.style.background = 'red';
        list6_txt.style.color = '#fff';
        list2.style.background = '#eee';
        list2_txt.style.color = '#666';
        list1.style.background = '#eee';
        list1_txt.style.color = '#666';

    }else {

    }
    list6.addEventListener('click',function(){
        window.scrollTo({
            top:3416,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 3700 || document.documentElement.scrollTop >= 3700){
        t.style.display = 'none';

    }
    if (document.body.scrollTop > 400 || document.documentElement.scrollTop > 400){
        right_top.style.display = 'block';
        right_top.addEventListener('click',function() {
            window.scrollTo({
                top:0,
                behavior:'smooth'
            })
        })
    }else {
        right_top.style.display = 'none';
    }
}


var an = document.querySelector("#anniu")
var nav = document.querySelector("#nav_nav");
var cha = document.querySelector("#cha_a");
var mn = 0;
an.addEventListener('click',function(){

        nav.style.display="block";
        an.style.display = "none";
        cha.style.display = "block";

})
cha.addEventListener('click',function(){

        nav.style.display="none";
        an.style.display = "block";
        cha.style.display = "none";
})